/**
 * @Author: 小狐
 * @Date: 2021/11/29 16:39
 * @Describe 主动去学习
 *
 */
package main

import (
	"dubbo.apache.org/dubbo-go/v3/config"
	_ "dubbo.apache.org/dubbo-go/v3/imports"
	"event/consumer/handle"
	"fmt"
	"github.com/gin-gonic/gin"
	"log"
	"path/filepath"
)



func main() {
	//读取消费者配置
	if configPath, err := filepath.Abs("consumer/dubbogo.yml"); err != nil {
		log.Fatal("配置文件缺少",err)
	}else{
		if err := config.Load(config.WithPath(configPath)); err != nil {
			panic(err)
		}
	}
	apiServer := gin.Default()
	apiServer.GET("/getEvent",handle.GetEvent)
	if err := apiServer.Run(":10000");err != nil {
		fmt.Println("事件服务启动失败")
	}

}
